package de.lang.rollo.controller.model.daos;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;

import org.mongojack.JacksonDBCollection;

import de.lang.rollo.controller.managed.MongoManaged;
import de.lang.rollo.controller.model.RolloEvent;
import de.lang.rollo.controller.model.RolloMotor;
import de.lang.rollo.controller.model.Schalter;

public class EventDAO {
	private static JacksonDBCollection<RolloEvent, String> events;
	private static JacksonDBCollection<RolloMotor, String> motoren;
	private static JacksonDBCollection<Schalter, String> schalter;
	EntityManager em;
	public EventDAO() {
		events = MongoManaged.getEvents();
		motoren = MongoManaged.getMotoren();
		
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("mongo");
		 em = emf.createEntityManager();

	}

	public void addEvent() {
		Query query = em
				.createQuery("Select o from RolloEvent o where o.totalCost > 1000");
		List<RolloEvent> orders = query.getResultList();
	}
}
